package com.s59.rabc.commen;

import lombok.Data;

@Data
public class Dta {
    private int code;
    private String message;
    private Object data;

    public Dta() {
    }

    private Dta(int code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public static Dta ok(){
        return new Dta(200,"成功",null);
    }

    public static Dta ok(Object data){
        return new Dta(200,"成功",data);
    }

    public static Dta err(String message){
        return new Dta(500,message,null);
    }

    public static Dta err(int code, String message){
        return new Dta(code,message,null);
    }

}
